export interface GetRoleListApiParams {
  page: number;
  limit: number;
  roleName: string;
}
/*
{
    "total": 24,
    "items": [
      {
        "id": "string",
        "gmtCreate": "2022-11-17 15:02:02",
        "gmtModified": "2022-11-17 15:02:02",
        "deleted": false,
        "roleName": "string",
        "remark": "string"
      }
    ]
  }
*/

export interface RoleItem {
  id: string;
  gmtCreate: string;
  gmtModified: string;
  roleName: string;
  // "deleted": false,
  // "remark": "string"
}
export type RoleList = RoleItem[];
export interface GetRoleListApiResponse {
  total: number;
  items: RoleList;
}

export interface UpdateRoleApiParams extends Pick<RoleItem, "roleName"> {
  id: string;
}

/*
 "children": [
      {
        "id": "1",
        "gmtCreate": "2019-11-15 17:13:06",
        "gmtModified": "2020-09-25 13:47:54",
        "deleted": false,
        "pid": "0",
        "name": "全部数据",
        "code": null,
        "toCode": null,
        "type": 1,
        "status": null,
        "level": 1,
        "children": [
          {
            "id": "1333329957008228353",
            "gmtCreate": "2020-11-30 16:40:08",
            "gmtModified": "2020-11-30 16:40:08",
            "deleted": false,
            "pid": "1",
            "name": "权限管理",
            "code": "Acl",
            "toCode": "",
            "type": 1,
            "status": null,
            "level": 2,
            "children": [
              {
                "id": "1333330082451472386",
                "gmtCreate": "2020-11-30 16:40:38",
                "gmtModified": "2020-11-30 16:40:38",
                "deleted": false,
                "pid": "1333329957008228353",
                "name": "用户管理",
                "code": "User",
                "toCode": "",
                "type": 1,
                "status": null,
                "level": 3,
                "children": [
                  {
                    "id": "1333330741791866881",
                    "gmtCreate": "2020-11-30 16:43:16",
                    "gmtModified": "2020-11-30 16:57:49",
                    "deleted": false,
                    "pid": "1333330082451472386",
                    "name": "添加用户",
                    "code": "btn.User.add",
                    "toCode": "",
                    "type": 2,
                    "status": null,
                    "level": 4,
                    "children": [],
                    "select": true
                  },
                ],
              },
            ]
          },
        ]
      }
  ]

*/

export interface PermissionItem {
  id: string;
  gmtCreate: string;
  gmtModified: string;
  pid: string;
  name: string;
  code: string;
  type: 1 | 2;
  level: 1 | 2 | 3 | 4;
  children: PermissionList;
  select: boolean;
  // "deleted": false,
  // status: string;
  // toCode: null;
}
export type PermissionList = PermissionItem[];
export interface GetRolePermissionListApiResponse {
  children: PermissionList;
}
